package com.syl.practice.globalexception.service;

import com.syl.practice.globalexception.dto.User;
import com.syl.practice.globalexception.enums.ApiEnum;
import com.syl.practice.globalexception.exception.ApiException;
import org.springframework.stereotype.Service;

@Service
public class ApiService {
    private static final String name = "hehe";

    public User getUser(){
        if (!"haha".equals(this.name)){
            throw new ApiException(ApiEnum.PARAMETER_NOT_EXIST);
        }
        return new User(1,"裴钱");
    }
}
